/*
 * ListImages.java
 *
 * Created on 14 marzec 2007, 10:20
 *
 */

package arocms.gallery;

import arocms.Constans;
import arocms.business.Image;
import arocms.business.ImageDAO;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.log4j.Logger;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

/**
 *
 * @author arek
 */
public class ListImages extends Action{

    private String SUCCESS = "success";
    private Logger log = Logger.getLogger(this.getClass());
    
    /** Creates a new instance of ListImages */
    public ListImages() {
    }

    public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
        log.debug("--> execute");
        List<Image> li = new ImageDAO().findAll();
        request.setAttribute(Constans.IMAGE_LIST_PATH, li);
        log.debug("<-- execute");
        return mapping.findForward(SUCCESS);
    }
    
}
